<?php
declare(strict_types=1);

namespace plugin\ky_black\app\admin\model;

use support\Model;

class OrganizationChangeLog extends Model
{
    protected $table = 'ky_organization_change_log';
    protected $primaryKey = 'log_id';
    
    protected $fillable = [
        'org_id',
        'change_type',
        'change_field',
        'old_value',
        'new_value',
        'operator_id',
        'operator_name',
        'remark'
    ];

    /**
     * 关联企业
     */
    public function organization()
    {
        return $this->belongsTo(Organization::class, 'org_id', 'org_id');
    }

    /**
     * 关联操作人
     */
    public function operator()
    {
        return $this->belongsTo(Staff::class, 'operator_id', 'staff_id');
    }
} 